package com.aaa.controller.jl;

import com.aaa.pojo.jl.ResltBean;
import com.aaa.pojo.jl.TesterSas;
import com.aaa.service.jl.TesterSasService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@RestController
public class TesterSasController {
    @Autowired
    private TesterSasService testerSasService;
    ResltBean resltBean = new ResltBean();
    @RequestMapping("/TesterSasFindAll")
    public ResltBean TesterSasfindAll(String page, String limit){
        int count = testerSasService.findCount();
        List<TesterSas> all = testerSasService.findAll(page,limit);
            resltBean.setCode(0);
            resltBean.setMsg("");
            resltBean.setCount(count);
            resltBean.setData(all);
            return resltBean;

    }
    @RequestMapping("/deleteId")
    @ResponseBody
    public ResltBean deleteId(String idList){
        System.out.println(idList);
        int i = testerSasService.deleteId(idList);
        resltBean.setCode(0);
        resltBean.setMsg("");
        resltBean.setCount(1);
        resltBean.setData(idList);
        return resltBean;
    }
    @RequestMapping("/deleteList")
    public ResltBean deleteList(List<String> idList){
        System.out.println(idList);
        int testerSas = testerSasService.deleteList(idList);
        resltBean.setCode(0);
        resltBean.setMsg("");
        resltBean.setCount(testerSas);
        resltBean.setData(idList);
        return resltBean;
    }

}
